package com.myBlast.client;

import com.myBlast.client.services.MyBlastServiceInterface;
import com.myBlast.client.services.MyBlastServiceInterfaceAsync;

import com.extjs.gxt.ui.client.GXT;
import com.extjs.gxt.ui.client.Style.Scroll;
import com.extjs.gxt.ui.client.util.Theme;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.RootPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class MyBlast implements EntryPoint {
	/**
	 * The message displayed to the user when the server cannot be reached or
	 * returns an error.
	 */
//	private static final String SERVER_ERROR = "An error occurred while "
//			+ "attempting to contact the server. Please check your network "
//			+ "connection and try again.";

	public static MyBlastServiceInterfaceAsync blastServiceInterfaceAsync = 
		(MyBlastServiceInterfaceAsync) GWT.create(MyBlastServiceInterface.class);
		
		
	/**
	 * The width of the client screen
	 */
	public static int clientWidth = 0;
	
	
	/**
	 * The height of the client screen 
	 */
	public static int clientHeight = 0;
	
	/**
	 * ViewPort object containing all the childrens 
	 */
	public static Viewport viewport = null;

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
//		width: 1272px; height: 33px;
		clientWidth = Window.getClientWidth();
		clientHeight = Window.getClientHeight();
		Element ele = RootPanel.get("header").getElement();
		ele.setAttribute("style", "width: "+ clientWidth+"px; height: 33px;");
		GXT.setDefaultTheme(Theme.BLUE, true);
		viewport = new Viewport();
		MyPortal example = new MyPortal();
//		TestWidget example = new TestWidget();
		viewport.add(example);
		viewport.setScrollMode(Scroll.AUTOY);
		RootPanel.get("container").add(viewport);
		GXT.hideLoadingPanel("loading");
	}
} // MyBlast
